package com.huahua.utils;


import com.huahua.utils.entity.TableInfo;
import com.huahua.utils.util.JDBCUtil;
import org.junit.Test;

import java.util.List;

public class CreatePojo {


    /**
     * 用于创建工程基础模板
     * @throws Exception
     */
    @Test
    public void test() throws Exception {
        GenerateProjectTemplate generate = new GenerateProjectTemplate("E:/IdeaProjects/xianxing/pojo_template/src/main/resources/ftl");
        generate.generateAllPojo("com.xianxing.common.pojo", "Pojo.ftl", "", "E:/IdeaProjects/xianxing/com-xianxing-service-api/com-xianxing-common-api");
//        List<TableInfo> tableDetails = JDBCUtil.getTableDetails();
//        for (TableInfo tableInfo : tableDetails) {
//            generate.generateMapper(tableInfo.getTableName(), "com.changgou.seckill.dao", "Mapper.ftl", "tb_", "E:/IdeaProjects/changgou/changgou-parent/changgou-service/changgou-service-seckill");
//            generate.generateService(tableInfo.getTableName(), "com.changgou.seckill.service", "Service.ftl", "tb_", "E:/IdeaProjects/changgou/changgou-parent/changgou-service/changgou-service-seckill");
//            generate.generateServiceImpl(tableInfo.getTableName(), "com.changgou.seckill.service.impl", "ServiceImpl.ftl", "tb_", "E:/IdeaProjects/changgou/changgou-parent/changgou-service/changgou-service-seckill");
//            generate.generateController(tableInfo.getTableName(), "com.changgou.seckill.controller", "Controller.ftl", "tb_", "E:/IdeaProjects/changgou/changgou-parent/changgou-service/changgou-service-seckill");
//        }
    }

}
